package cn.lanqiao.system.service.impl;

import cn.lanqiao.common.vo.FilmVo;
import cn.lanqiao.system.mapper.FilmMapper;
import cn.lanqiao.system.mapper.TypeMapper;
import cn.lanqiao.system.service.TypeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;
import org.springframework.stereotype.Service;

import java.util.List;
@Service
@Repository
public class TypeServiceImpl implements TypeService {
    @Autowired
    private TypeMapper typeMapper;
    @Autowired
    private FilmMapper filmMapper;
    @Override
    public List<FilmVo> findByTypeName(String typeName) {
        if(typeName.equals("全部")){
            return filmMapper.getAll();
        }else{
            return typeMapper.findByTypeName(typeName);
        }

    }
}
